<?php
/**
 * @see Mage_Adminhtml_Block_Catalog_Product
 */
?>
<div class="content-header">
<table cellspacing="0">
    <tr>
        <td style="width:50%;"><h3 class="icon-head head-products"><?php echo Mage::helper('vendorswarehouse')->__('Manage Orders') ?></h3></td>
        <td class="a-right">
            <?php echo $this->getButtonsHtml() ?>
        </td>
    </tr>
</table>
</div>

<div>
    <?php echo $this->getGridHtml() ?>
</div>


<script type="text/javascript">
	var confirm = {};
	confirm.order = Class.create();
	confirm.order.prototype = {
		
		initialize  : function(grid,containerId) {
			          this.containerId = containerId;
			          this.grid = grid;},
					
		updateOrder : function(productId, attributes) {
			          this.grid.reload(null);},

		createPopup : function(url){
		    	      if (this.win && !this.win.closed) {
		                this.win.close();
					  }

		              this.win = window.open(url, '',
		                  'width=1000,height=700,resizable=1,scrollbars=1');
		              this.win.focus();},
					  
		createOrder : function(createOrderUrl){
					  this.createPopup(createOrderUrl)},
					  
		editOrder   : function(){
			    	  this.createPopup(this.editOrderUrl)}
	}

	var confirmation = new confirm.order('<?php echo $this->getGridJsObject() ?>');
</script>

